import VueSocketIO from 'vue-socket.io'
import SocketIOClt from 'socket.io-client'

const socketIO = new VueSocketIO({
  debug: true,
    //connection: SocketIOClt.connect('47.115.226.41/:5001', { //在本地环境测试地址配nginx服务地址，部署配window.location.host
    connection: SocketIOClt.connect(window.location.hostname+':5001', { //在本地环境测试地址配nginx服务地址，部署配window.location.host
    // connection: SocketIOClt.connect('http://192.168.16.231:5001', { //在本地环境测试地址配nginx服务地址，部署配window.location.host
    path: '', 
    transports: ['websocket', 'xhr-polling', 'jsonp-polling']
  })
})

export default socketIO
